package cn.edu.ctbu.sbadmin.grade.dao;


import cn.edu.ctbu.sbadmin.common.core.MyMapper;
import cn.edu.ctbu.sbadmin.grade.domain.TeacherDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/*
 * @description
 * @param null
 * @author HighJ
 * @date 2022/4/13 9:51
 */

@Mapper
public interface TeacherDao extends MyMapper<TeacherDO> {

    @Select("SELECT\n" +
            "teacher.id,\n" +
            "teacher.`name`,\n" +
            "teacher.t_no as username,\n" +
            "teacher.gender,\n" +
            "teacher.qualification_level,\n" +
            "teacher.`password`,\n" +
            "teacher.last_time,\n" +
            "teacher.last_ip,\n" +
            "teacher.avatar,\n" +
            "teacher.gmt_create,\n" +
            "teacher.gmt_modified,\n" +
            "teacher.is_deleted,\n" +
            "teacher.gmt_delete,\n" +
            "teacher.delete_userid\n" +
            "FROM\n" +
            "teacher\n" +
            "${ew.customSqlSegment}")
    IPage<TeacherDO> selectPage(IPage<TeacherDO> page,
                                @Param(Constants.WRAPPER) QueryWrapper<TeacherDO> queryWrapper);
}
